feat(ai): implement 5 OpenAI-compatible LLM adapters (Groq, DeepSeek, Mistral, xAI, Cerebras)#66
Open
forgou37 wants to merge 1 commit into
Open
Conversation
…tack#63) Converts stubs → working integrations for: Groq, DeepSeek, Mistral, xAI (Grok), and Cerebras. All five speak the OpenAI /v1/chat/completions wire protocol — only base URL, default model, models list, and API key env var differ from the openai adapter. Changes per adapter: - Real fetch() call to /v1/chat/completions - Dry-run short-circuit before network request - HTTP status + first 200 chars of body in error messages - inputTokens / outputTokens extracted from usage field - setup wizard with provider-specific doc URL and steps Groq: api.groq.com/openai · llama-3.3-70b-versatile · GROQ_API_KEY DeepSeek: api.deepseek.com · deepseek-chat · DEEPSEEK_API_KEY Mistral: api.mistral.ai · mistral-large-latest · MISTRAL_API_KEY xAI: api.x.ai · grok-3 · XAI_API_KEY Cerebras: api.cerebras.ai · llama-3.3-70b · CEREBRAS_API_KEY Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
please resolve conflicts |
Contributor
Author
|
The stub files already exist in upstream master (added by the BYOK stubs commit), so there's an add/add conflict when rebasing. I resolved the conflicts in favor of the full implementation, but the PAT lacks |
Contributor
|
still has conflicts. please rebase. |
Contributor
|
@copilot resolve the merge conflicts in this pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #63.
Converts the 5 BYOK stubs into working integrations. All providers use the OpenAI
/v1/chat/completionswire format — the implementation follows theopenaiadapter exactly, with provider-specific base URL, default model, models list, and API key env var.Changes
api.groq.com/openaillama-3.3-70b-versatileGROQ_API_KEYapi.deepseek.comdeepseek-chatDEEPSEEK_API_KEYapi.mistral.aimistral-large-latestMISTRAL_API_KEYapi.x.aigrok-3XAI_API_KEYapi.cerebras.aillama-3.3-70bCEREBRAS_API_KEYEach adapter:
fetch()calls to/v1/chat/completionsctx.dryRuninputTokens/outputTokensfromusage.prompt_tokens/usage.completion_tokenssetupwizard with provider-specific doc URL and steps🤖 Generated with Claude Code